class Dog(object):
    def __init__(self,name):
        self.name = name
    def game(self):
        print(f"{self.name}简单的玩耍")
class XiaoTainDog(Dog):
    def game(self):
        print(f'{self.name}在天上玩耍')
class Person(object):

    def with_game(self,dog):
        dog.game()
        print(f'人和{dog.name}在玩耍')
# 创建对象
n1 = Dog('大黄')
n1.game()
n2 = XiaoTainDog('小黄')
n2.game()
p1 = Person()
p1.with_game(n1)
p1.with_game(n2)